package demo4;

import java.util.Arrays;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int sum = scanner.nextInt();
        boolean[] flag = new boolean[n + 2];
        int[] nums = new int[n + 2];
        dfs(n, sum, flag, nums, 1);
    }
    private static boolean fund;
    private static void dfs(int n, int sum, boolean[] flag,
                            int[] nums, int path) {
        if(fund) {
            return;
        }
        //最后
        if(path == n + 1) {
            int[] num2 = Arrays.copyOf(nums, n + 2);
            for(int i = 1; i < n; i++) {
                for(int j = 1; j <= n - i + 1; j++) {
                    num2[j] += num2[j + 1];
                }
            }
            if(num2[1] == sum) {
                for(int i = 1; i <= n; i++) {
                    System.out.print(nums[i] + " ");
                }
                fund = true;//找到
            }
            return;
        }
        //回溯
        for(int i = 1; i <= n; i++) {
            if(!flag[i] && !fund) {
                flag[i] = true;
                nums[path] = i;
                dfs(n, sum, flag, nums, path + 1);
                flag[i] = false;
            }
        }
    }
}
